Skip to content

Conversation

@samuelbray32
Copy link
Collaborator

@samuelbray32 samuelbray32 commented Nov 20, 2025

Checklist:

  • If this PR should be accompanied by a release, I have updated the CITATION.cff
  • If this PR edits table definitions, I have included an alter snippet for release notes.
  • If this PR makes changes to position, I ran the relevant tests locally.
  • If this PR makes user-facing changes, I have added/edited docs/notebooks to reflect the changes
  • I have updated the CHANGELOG.md with PR number and description.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request fixes three issues related to NWB file access through Dandi:

  • Fix #1473: Refactored _open_nwb_file to handle raw NWB file path resolution internally, ensuring files are cached using the correct key
  • Fix #1472: Removed redundant code that forced nwb2load_filepath into fetch attributes, avoiding unnecessary external table access
  • Fix #1428: Added str() conversion to ensure AnalysisNwbfile.get_abs_path consistently returns string objects when fetching from schema

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/spyglass/utils/nwb_helper_fn.py Centralized Dandi path resolution logic in _open_nwb_file to properly handle both direct file paths and raw paths, and simplified get_nwb_file by consolidating path checking conditions
src/spyglass/utils/mixins/analysis.py Added explicit string conversion for path returned from schema externals table to ensure consistent string return type
src/spyglass/utils/dj_helper_fn.py Removed redundant code that unnecessarily added nwb2load_filepath to fetch attributes, as this attribute is populated in the loop regardless

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error accessing dandi-loaded raw files Error for fetching non-local files Error in fetch_nwb due to inconsistent path type

2 participants